package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.SchGradeMapper;
import com.ruoyi.teach.domain.SchGrade;
import com.ruoyi.teach.service.ISchGradeService;

/**
 * 学年Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class SchGradeServiceImpl implements ISchGradeService 
{
    @Autowired
    private SchGradeMapper schGradeMapper;

    /**
     * 查询学年
     * 
     * @param gId 学年主键
     * @return 学年
     */
    @Override
    public SchGrade selectSchGradeByGId(Long gId)
    {
        return schGradeMapper.selectSchGradeByGId(gId);
    }

    /**
     * 查询学年列表
     * 
     * @param schGrade 学年
     * @return 学年
     */
    @Override
    public List<SchGrade> selectSchGradeList(SchGrade schGrade)
    {
        return schGradeMapper.selectSchGradeList(schGrade);
    }

    /**
     * 新增学年
     * 
     * @param schGrade 学年
     * @return 结果
     */
    @Override
    public int insertSchGrade(SchGrade schGrade)
    {
        schGrade.setCreateTime(DateUtils.getNowDate());
        return schGradeMapper.insertSchGrade(schGrade);
    }

    /**
     * 修改学年
     * 
     * @param schGrade 学年
     * @return 结果
     */
    @Override
    public int updateSchGrade(SchGrade schGrade)
    {
        schGrade.setUpdateTime(DateUtils.getNowDate());
        return schGradeMapper.updateSchGrade(schGrade);
    }

    /**
     * 批量删除学年
     * 
     * @param gIds 需要删除的学年主键
     * @return 结果
     */
    @Override
    public int deleteSchGradeByGIds(Long[] gIds)
    {
        return schGradeMapper.deleteSchGradeByGIds(gIds);
    }

    /**
     * 删除学年信息
     * 
     * @param gId 学年主键
     * @return 结果
     */
    @Override
    public int deleteSchGradeByGId(Long gId)
    {
        return schGradeMapper.deleteSchGradeByGId(gId);
    }
}
